﻿<UserControl x:Class="Rifts.Controls.CharacterSheetPage2"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:l="clr-namespace:Rifts.Controls"
			 mc:Ignorable="d" 
			 Width="768"
			 Height="960"
			 >
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Granite.Xaml;component/ConvertersList.xaml" />
				<ResourceDictionary Source="/Assets/Styles.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>

	<Border BorderBrush="Black" BorderThickness="2">
		<StackPanel>
			<l:SectionPanel Header="Skills &amp; Abilities" >
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="*"/>
					</Grid.ColumnDefinitions>

					<l:GroupPanel Header="Skills" Padding="4">
						<StackPanel>
							<!--<StackPanel Orientation="Horizontal">
								<TextBlock Width="10" Text="" />
								<TextBlock Width="290" Text="Skill" />
								<TextBlock Width="60" Text="Score" />
							</StackPanel>-->

							<ItemsControl ItemsSource="{Binding Skills}">
								<ItemsControl.ItemTemplate>
									<DataTemplate>
										<StackPanel>
											<StackPanel Orientation="Horizontal" >
												<TextBlock Text="{Binding Name}" Width="290" />
												<TextBlock Width="10" Text="" />
												<l:CalculatedTextBlock Text="{Binding Score, StringFormat={} {0}%}" Visibility="{Binding Score, Converter={StaticResource NotZeroToVisibleConverter}}" Width="20"/>
												<l:CalculatedTextBlock Text="{Binding SecondaryScore, StringFormat={}\/{0}%}" Visibility="{Binding SecondaryScore, Converter={StaticResource NotZeroToVisibleConverter}}" Width="20"/>
											</StackPanel>
											<!--<TextBlock Text="{Binding BookReference}" Visibility="{Binding BookReference, Converter={StaticResource NotZeroToVisibleConverter}}"  FontStyle="Italic" />-->




											<ItemsControl ItemsSource="{Binding Abilities}" Margin="10,0,0,0">
												<ItemsControl.ItemTemplate>
													<DataTemplate>
														<StackPanel>
															<Grid >
																<Grid.ColumnDefinitions>
																	<ColumnDefinition Width="290"/>
																	<ColumnDefinition Width="50"/>
																</Grid.ColumnDefinitions>
																<TextBlock Text="{Binding Name}" Width="280" Grid.Column="0" />
																<l:CalculatedTextBlock Text="{Binding Score, StringFormat={} {0}%}" Visibility="{Binding Score, Converter={StaticResource NotNullToVisibleConverter}}" Width="20" Grid.Column="1"/>
															</Grid>
															<TextBlock Text="{Binding BookReference}" Visibility="{Binding BookReference, Converter={StaticResource NotZeroToVisibleConverter}}"  FontStyle="Italic" />
														</StackPanel>
													</DataTemplate>
												</ItemsControl.ItemTemplate>
											</ItemsControl>



										</StackPanel>
									</DataTemplate>
								</ItemsControl.ItemTemplate>
							</ItemsControl>

						</StackPanel>
					</l:GroupPanel>

					<l:GroupPanel Header="Abilities" Grid.Column="1" Padding="4">
							<ItemsControl ItemsSource="{Binding Abilities}">
								<ItemsControl.ItemTemplate>
									<DataTemplate>
										<StackPanel>
											<Grid >
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="300"/>
													<ColumnDefinition Width="50"/>
												</Grid.ColumnDefinitions>
												<TextBlock Text="{Binding Name}" Width="290" Grid.Column="0" />
												<l:CalculatedTextBlock Text="{Binding Score, StringFormat={} {0}%}" Visibility="{Binding Score, Converter={StaticResource NotNullToVisibleConverter}}" Width="25" Grid.Column="1"/>
											</Grid>
											<TextBlock Text="{Binding BookReference}" Visibility="{Binding BookReference, Converter={StaticResource NotZeroToVisibleConverter}}"  FontStyle="Italic" />
										</StackPanel>
									</DataTemplate>
								</ItemsControl.ItemTemplate>
							</ItemsControl>
					</l:GroupPanel>

				</Grid>
			</l:SectionPanel>
		</StackPanel>
	</Border>
</UserControl>
